package com.csgc.camera.widget.dialog

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.view.Gravity
import androidx.annotation.StyleRes
import androidx.core.content.ContextCompat.getSystemService

import com.csgc.camera.util.clickWithTrigger
import com.csgc.camera.widget.dialog.base.AnimAction
import com.csgc.camera.widget.dialog.base.BaseDialog
import com.cysd.spsyxj.R

import com.hjq.shape.view.ShapeTextView
import com.hjq.toast.ToastUtils


class ContactUsDialog constructor(context: Context, @StyleRes themeResId: Int = R.style.BaseDialogTheme):
    BaseDialog(context,themeResId) {
    private val copyQQ: ShapeTextView? by lazy { findViewById(R.id.tv_copy_qq) }
        init {
            setContentView(R.layout.dialog_contact_us)
            setWindowAnimations(AnimAction.ANIM_IOS)
            setGravity(Gravity.CENTER)

         copyQQ?.clickWithTrigger {
             //获取剪贴板管理器：
             val cm: ClipboardManager? = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager?
             val mClipData = ClipData.newPlainText("Label", "1458269835")
             cm?.setPrimaryClip(mClipData)
             ToastUtils.show("复制成功！")
             dismiss()
         }
        }


}